﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>

    <link rel="stylesheet" href="/ViewV5/CSS/icfont_qj/iconfont.css">
    <link href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/animate.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <style>
        .ms-controller, .ms-important, [ms-controller], [ms-important] {
            visibility: hidden;
        }

        .progress-of {
            height: 3px;
            background: #e1e6ea;
        }

            .progress-of .list {
                width: 33.333%;
                float: left;
                height: 100%;
                position: relative;
            }

                .progress-of .list span {
                    width: 15px;
                    height: 15px;
                    display: inline-block;
                    position: absolute;
                    left: 50%;
                    margin-left: -5px;
                    top: -5px;
                    background: #e1e6ea;
                    border-radius: 50%;
                }

                .progress-of .list i {
                    position: relative;
                    top: -30px;
                    display: inline-block;
                }

                .progress-of .list.active {
                    background: #2798df;
                }

                    .progress-of .list.active span {
                        background: #2798df;
                    }

        .progress-item {
            margin-bottom: 40px;
        }

        .progress-item-select {
            margin-left: 25px;
        }

            .progress-item-select select {
                width: 200px;
                height: 25px;
                margin-top: 5px;
            }

        .progress-btn {
            position: fixed;
            bottom: 0;
            right: 0;
            padding: 20px;
            border-top: 1px solid #E7E7E7;
            width: 100%;
            background: #F9F9F9;
        }
    </style>
    
</head>
<body>
    <div class="container-fluid" ms-controller="LIST">
        <div class="padding20" style="padding-bottom:90px;">
            <div class="progress-of tc" style="margin-top:40px;margin-bottom:30px;display:none">
                <div class="list active">
                    <span></span>
                    <i>选择历史明细</i>
                </div>
                <div class="list">
                    <span></span>
                    <i>预览数据</i>
                </div>
                <div class="list">
                    <span></span>
                    <i>完成</i>
                </div>
            </div>
            <div class="tab">
                <h5 class="pull-left tr">选择计划：{{JHDATA.JHTitle}}<a href="#" ms-click="changejihua()">更改</a></h5>
                <div class="grid">
                    <div id="jqxgrid" class="jqxgrid" style=""></div>

                </div>
            </div>
            <div class="tab" style="display:none;">
                <div class="default-tab ft14 pt20 table-responsive" style="margin-top:1rem; max-height:300px">


                </div>
            </div>
            <div class="tab" style="display:none;">
                <span></span>
                <br />
                <span style="color:green;">{{ImportMsg|html}}</span>
                <span style="color:red;">{{ErrorMsg|html}}</span>
            </div>
        </div>


    </div>
    <link href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <script src="/ViewV5/JS/avalon1.47.js"></script>
    <script src="/ViewV5/JS/layer/layer.js"></script>
    <script src="/VIEWV5/JS/YanGrid/jqwidgets/jqgridall.js"></script>

    <script src="/ViewV5/JS/SZHLCommon.js?V=1"></script>

    <link rel="stylesheet" href="/ViewV5/JS/YanGrid/jqwidgets/styles/jqx.base.css" />
    <link rel="stylesheet" href="/ViewV5/JS/YanGrid/jqwidgets/styles/jqx.office.css" />
    <script type="text/javascript">
        var goption = {
            columns: [
                     {
                         text: '1', dataField: 'issel', pinned: true, columntype: 'checkbox', width: 40, editable: true, sortable: false, filterable: false, groupable: false, draggable: false, resizable: false,
                         renderer: function () {
                             return '<div style="margin-left: 10px; margin-top: 5px;"></div>';
                         },
                         rendered: function (element) {
                             $(element).jqxCheckBox({ theme: "office", width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 });
                             // columnCheckBox = $(element);
                             $(element).on('change', function (event) {
                                 var checked = event.args.checked;
                                 if (checked == null || false) return;
                                 var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;
                                 $("#jqxgrid").jqxGrid('beginupdate');

                                 if (checked) {
                                     $("#jqxgrid").jqxGrid('selectallrows');
                                 }
                                 else if (checked == false) {
                                     $("#jqxgrid").jqxGrid('clearselection');
                                 }

                                 for (var i = 0; i < rowscount; i++) {
                                     $("#jqxgrid").jqxGrid('setcellvalue', i, 'issel', event.args.checked);
                                 }

                                 $("#jqxgrid").jqxGrid('endupdate');
                             });
                             return true;
                         }
                     },
                  { text: 'ID', dataField: 'ID', hidden: "hides" },
                  { text: '备注1', dataField: 'statusremark', hidden: "hides" },
                   { text: '单位名称', dataField: 'dwname', width: 120 },
                   { text: '项目期别', dataField: 'Remark1', width: 120 },
                  { text: '计划属性', dataField: 'FLName', width: 120 },
                  { text: '合同编号', dataField: 'htbh', width: 120 },
                  { text: '对方单位或个人', dataField: 'dfdw', width: 120 },
                  { text: '合同内容', dataField: 'htnr', width: 120 },
                  { text: '是否预付款', dataField: 'sfyfk', width: 120 },
                  { text: '付款级次', dataField: 'fkjcid', width: 120 },
                  { text: '合同节点', dataField: 'htjdname', width: 200 },
                  { text: '应付款总额', dataField: 'yfkze', width: 120 },
                  { text: '已付额', dataField: 'yfe', width: 120 },
                  { text: '已付比', dataField: 'yfbl', width: 120 },
                  { text: '截止当前欠款', dataField: 'dqqk', width: 120 },
                  { text: '账龄(月)', dataField: 'zhangling', width: 120 },
                  { text: '金额小计', dataField: 'jexj', width: 120 },
                  { text: '第一月', dataField: 'je1' },

                  { text: '第一月描述', dataField: 'je1dec' },

                    {
                        text: '计划状态', dataField: 'status', filterable: false, editable: false,
                        groupable: false, draggable: false, resizable: false, width: 100, cellsrenderer: function (row, column, value) {
                            var data = $('#jqxgrid').jqxGrid('getrowdata', row);
                            var desc = ComFunJS.jhzcstatus(data.status, data);

                            var html = "";
                            //html = '<a href="#" onclick="tempindex.showzt(\'' + row + '\')"><p class="text-error" style="display: inline;font-size: 16px;    color: blue;">' + desc + '</p></a>';
                            var returns = ' <div style="overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; text-align: left; margin-right: 2px; margin-left: 4px; margin-top: 12px;">' + desc + '</div>';
                            return returns;
                        }
                    }


            ]
        };

        var tempindex = avalon.define({
            $id: "LIST",
            tmpListData: [],
            JHDATA: {},
            selids: "",
            changejihua: function () {
               top.ComFunJS.winbtnwin("/ViewV5/AppPage/JHGL/JHGLSELLIST.html", "选择计划", 900, 540, {}, function (layero, index) {
                    var frameid = $("iframe", $(layero)).attr('id');
                    var seldata = ComFunJS.isIE() ? top.window.frames[frameid].model.getseldata() : top.window.frames[frameid].contentWindow.model.getseldata();
                    if (seldata.length > 0) {
                        tempindex.JHDATA = seldata[0];
                        tempindex.GetLIST();

                    }
                   top.layer.close(index)
                })
            },
            getcheckid: function () {
                tempindex.selids = "";
                var rowindexes = $('#jqxgrid').jqxGrid('getselectedrowindexes');
                for (var i = 0; i < rowindexes.length; i++) {
                    var data = $('#jqxgrid').jqxGrid('getrowdata', rowindexes[i]);
                    if (i == 0) {
                        tempindex.selids = data.ID;
                    } else {
                        tempindex.selids = tempindex.selids + "," + data.ID;

                    }
                }
                return tempindex.selids;
            },
            GetLIST: function () {
                try {
                    $('#jqxgrid').jqxGrid('destroy');

                } catch (e) {

                }
                $(".grid").append('<div id="jqxgrid" class="jqxgrid"></div>')
                $.getJSON('/API/VIEWAPI.ashx?Action=JHZC_GETLSMXLIST', { P1: tempindex.JHDATA.ID, P2: "" }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        for (var i = 0; i < resultData.Result.length; i++) {
                            resultData.Result[i].issel = "false";
                        }
                        ComFunJS.inithighgrid(goption, resultData.Result, "jqxgrid");
                        tempindex.tmpListData = resultData.Result;
                    }
                })
            }
        })
        avalon.ready(function () {
            $.getJSON('/API/VIEWAPI.ashx?Action=JHZC_GETLSJH', { P1: "", P2: "" }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    tempindex.JHDATA = resultData.Result;
                    tempindex.GetLIST();

                }
            })
        })
    </script>
</body>
</html>
